package com.mdd.front.service;

import com.alipay.api.AlipayApiException;
import com.alipay.api.response.AlipayFundAuthOperationDetailQueryResponse;
import com.mdd.common.entity.OrderFlowInfo;
import com.mdd.common.enums.order.type.OrderFlowTypeEnum;
import com.mdd.front.validate.agreement.UserAgreementSign;
import com.mdd.front.validate.freeze.FreezeInfo;
import com.mdd.front.vo.agreement.UserSignVo;
import com.mdd.front.vo.order.OrderIdValidate;

import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;

/**
 * TODO
 *
 * @Description
 * @Author 幻速
 * @Date 2023/11/2 10:00
 **/
public interface IAuthOrderService {
    /**
     * 预授权签约接口
     * @param orderIdValidate
     * @return
     * @throws AlipayApiException
     */
    String authOrderFreeze(OrderIdValidate orderIdValidate)  ;

    /**
     * 根据风控分获取押金钱数
     * @param price
     * @param riskScore
     * @return
     */
    Double getByRiskScore(BigDecimal price, Double riskScore);

    /**
     * 代扣签约接口
     * @param orderIdValidate
     * @return
     * @throws AlipayApiException
     */
    String userAgreementPageSign(OrderIdValidate orderIdValidate) ;

    UserSignVo getSignStatus(OrderIdValidate orderIdValidate);

    /**
     * 取消押金冻结
     * @param orderId
     */
    void cancelAuthOrderFreeze(Long orderId) throws AlipayApiException;

    /**
     * 取消代扣授权
     * @param orderId
     */
    void cancelUserAgreementRecord(Long orderId) throws AlipayApiException;
    AlipayFundAuthOperationDetailQueryResponse queryAuthOrderFreeze(Long orderId) throws AlipayApiException;

    OrderFlowInfo saveFlowInfoLog(Long orderId, OrderFlowTypeEnum orderFlowTypeEnum, BigDecimal amount);
}
